package com.wdy.golden.tinysql.util;

import java.io.Serializable;
import java.lang.reflect.Field;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

public class BaseSerializable implements Serializable {

	private static final long serialVersionUID = 1L;

	public String toString() {
//		return JSON.toJSONString(this);
		
//		return ReflectionToStringBuilder.toString(this, ToStringStyle.DEFAULT_STYLE);
		return (new ReflectionToStringBuilder(this) {
			protected boolean accept(Field f) {
				return super.accept(f) && !StringUtil.containsIgnoreCase(f.getName(), "password");
			}
		}).toString();
	}

}
